﻿<phone:PhoneApplicationPage 
    x:Class="Coding4Fun.Toolkit.Test.WindowsPhone.Samples.Timespan"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:c4f="clr-namespace:Coding4Fun.Toolkit.Controls;assembly=Coding4Fun.Toolkit.Controls" 
    xmlns:Controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
	xmlns:ms="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
		<ms:Pivot Title="{StaticResource AppName}">
			<ms:PivotItem Header="base">
				<StackPanel>
					<TextBlock>stock</TextBlock>
					<c4f:TimeSpanPicker />
					
					<TextBlock>custom format</TextBlock>
					<c4f:TimeSpanPicker
						Name="foo"
						ValueStringFormat="{}{0:hh} - {0:mm} - {0:ss}"
						/>

					<TextBlock>Max 2 hours, Steps 10 min, custom title</TextBlock>
					<c4f:TimeSpanPicker
						DialogTitle="coding4fun timespan picker"
						Maximum="{Binding TimeSpan2Hour}" 
						StepFrequency="{Binding TimeSpan10Min}"/>

					<TextBlock>Min 10min, Max 30min, Step 5 min, set to 5</TextBlock>
					<c4f:TimeSpanPicker
						Value="{Binding TimeSpan5Min}"
                        Minimum="{Binding TimeSpan10Min}" 
						Maximum="{Binding TimeSpan30Min}" 
						StepFrequency="{Binding TimeSpan5Min}" 
						ValueChanged="TimeSpanPicker_ValueChanged" />
                    <TextBlock>Invalid Time set 2h, max of 30min</TextBlock>
                    <c4f:TimeSpanPicker
						Value="{Binding TimeSpan2Hour}"
						Maximum="{Binding TimeSpan30Min}" 
						StepFrequency="{Binding TimeSpan5Min}" />
                    
                    <Button Click="LaunchPickerClick">Launch Via OpenPicker()</Button>
				</StackPanel>
			</ms:PivotItem>
			<ms:PivotItem Header="set lang">
				<StackPanel>
					<TextBlock>Set Language</TextBlock>
					<Controls:WrapPanel>
						<Button Content="en-US" Click="SetLanguage_Click"/>
						<Button Content="de-DE" Click="SetLanguage_Click" />
						<Button Content="es-ES" Click="SetLanguage_Click" />
						<Button Content="fr-FR" Click="SetLanguage_Click" />
						<Button Content="it-IT" Click="SetLanguage_Click" />
						<Button Content="cs-CZ" Click="SetLanguage_Click" />
						<Button Content="ko-KR" Click="SetLanguage_Click" />
						<Button Content="ru-RU" Click="SetLanguage_Click" />
						<Button Content="sk-SK" Click="SetLanguage_Click" />
						<Button Content="pl-PL" Click="SetLanguage_Click" />
					</Controls:WrapPanel>
				</StackPanel>
			</ms:PivotItem>
		</ms:Pivot>
		<TextBlock
			Name="resultBlock"
			Text="result: ##"
			VerticalAlignment="Bottom" />
    </Grid>
</phone:PhoneApplicationPage>
